<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>
<script type="text/javascript">
//오늘날짜
var nowDate = null;
//화면에 보이는 설정된 날짜
var setDate = null;

var rooms = null;

var pr_nos = [];
<%
String[] pr_nos = request.getParameterValues("pr_nos");
if(pr_nos!=null){
	for(int i = 0; i<pr_nos.length;i++){
		out.println("pr_nos.push('"+pr_nos[i]+"');");
	}
}
%>
var rsv_days = [];
<%
String[] rsv_days = request.getParameterValues("rsv_days");
if(rsv_days!=null){
	for(int i = 0; i<rsv_days.length;i++){
		out.println("rsv_days.push('"+rsv_days[i]+"');");
	}
}

%>

var man_cnts = [];
<%
String[] man_cnts = request.getParameterValues("man_cnts");
if(man_cnts!=null){
	for(int i = 0; i<man_cnts.length;i++){
		out.println("man_cnts.push('"+man_cnts[i]+"');");
	}
}

%>

var chi_cnts = [];
<%
String[] chi_cnts = request.getParameterValues("chi_cnts");
if(chi_cnts!=null){
	for(int i = 0; i<chi_cnts.length;i++){
		out.println("chi_cnts.push('"+chi_cnts[i]+"');");
	}
}

%>


// 0,1,2,3,4,5,6 : 일,월,화,수,목,금,토
var dayOfTheWeek = "0";
//핫 튜스 롤링
var rollCnt = 1;
var rollMaxcnt=0;
function hotRolling(){
	if(rollCnt==(rollMaxcnt-1)){
		rollCnt=0;
	}
	
	$("#hotNew > div").hide();
	$("#hot"+rollCnt).slideDown();	
	rollCnt++;
}
$(document).ready(function(){
	<c:if test="${hotList !=null && fn:length(hotList)>0 }">
	rollMaxcnt = ${fn:length(hotList)};
	</c:if>
	
	<c:if test="${hotList !=null && fn:length(hotList)>1 }">
	setInterval( "hotRolling();", 2000);
	</c:if>
// 	setInterval( "hotRolling();", 2000);
	
	setDate = new Date(${fn:substring(reservation_dt,0,4)},${fn:substring(reservation_dt,4,6)-1},${fn:substring(reservation_dt,6,8)});
	nowDate  = new Date().toString("yyyyMMdd");
	
	//객실 정보 가져오기
	var option = {
			url: "./pere101Q.do",
			data : {"p_id":'${param.p_id}'},
			success : function(json){
				rooms = json;
				changeNewDate(0);
			}
	};
	$.getJson(option);
	
});


//테이블에 쓸 객실명 가져오기
var tableRooms="";
function getTableRooms(){
	if(tableRooms==""){
		return setTableList();
	}else{
		return tableRooms;
	}
}

function changeNewDateRedirect(num){
	var ddd = setDate.clone();
	ddd.addMonths(num);
	ddd.set({day:1});
	var pr_no_tmp = "";
	if(""!="${param.pr_no}"){
		pr_no_tmp="&pr_no=${param.pr_no}";
	}
	location.href="./petc1004Q.do?p_id=${param.p_id}&reservation_dt="+ddd.toString("yyyyMMdd")+pr_no_tmp;
}

//객실 셋팅
function setRooms(){
	
	//객실 정보 가져오기(요금, 예약현황, 연박)
	var option = {
			url: "./pere201Q.do",
			data : {"p_id":'${param.p_id}',"reservation_dt":"${reservation_dt}"},
			success : function(json){
				if(rooms!=null){
					var html="";
					var busy_type="";
					
					
					$.each(rooms.list, function (i) {
						var me_pr_no = this.pr_no;
						var roomMap = null;
						var ParamIdx=99999;
						$.each(json.list, function (jj) {
							if(me_pr_no==this.pr_no){
								roomMap = json.list[jj];
							}
						});
						
						for(var l=0; l<pr_nos.length;l++){
							if(pr_nos[l]==me_pr_no){
								ParamIdx=l;
								break;
							}
						}
						
						
						var use_max_cnt = this.use_max_cnt;
						var use_man_cnt = this.use_man_cnt;
						var selectHtml = "";
						var selectHtml_ch = "";
						
						//요금
						var busy_1_base = this.busy_1_base;
						var busy_1_fri = this.busy_1_fri;
						var busy_1_sat = this.busy_1_sat;
						var busy_2_base = this.busy_2_base;
						var busy_2_fri = this.busy_2_fri;
						var busy_2_sat = this.busy_2_sat;
						var busy_3_base = this.busy_3_base;
						var busy_3_fri = this.busy_3_fri;
						var busy_3_sat = this.busy_3_sat;
						
						busy_type = roomMap.busy_type;
						if(i==0){
							if("0110"==busy_type){
								$("#tdSaveBtn").hide();
							}else{
								$("#tdSaveBtn").show();
							}
						}
						
						
						var busy_1="ptrpr02";
						var busy_2="ptrpr02";
						var busy_3="ptrpr02";
						var busy_4="ptrpr02";
						var busy_5="ptrpr02";
						var busy_6="ptrpr02";
						var busy_7="ptrpr02";
						var busy_8="ptrpr02";
						var busy_9="ptrpr02";

						//이벤트일때 html
						var eventHtml = "";
						
						if(busy_type==""){
							//금요일일때
							if(dayOfTheWeek=='5'){
								busy_2="ptrpr01";
							}else if(dayOfTheWeek=='6'){
								//토요일일때
								busy_3="ptrpr01";
							}else{
								//주중일때
								busy_1="ptrpr01";
							}
							
						}else{
							
							if((null!=roomMap.pm_per && 0!=roomMap.pm_per) || (null!=roomMap.pm_dc_m && 0!=roomMap.pm_dc_m)){
								var dcType="";
								if(0!=roomMap.pm_per){
									dcType="("+roomMap.pm_per+"% 할인)";
								}else if(0!=roomMap.pm_dc_m){
									dcType="("+$.comma(roomMap.pm_dc_m)+" 원 할인)";
								}
								//할인 이벤트 일때
								eventHtml="				<tr align=\"center\">"+
								"					<td width=\"25%\" height=\"20\" bgcolor=\"#f5f5f5\" class=\"border2bg\">이벤트</td>"+
								"					<td width=\"25%\" class=\"border2lbg\" colspan='3'><span class=\"ptrpr01\">"+$.comma(roomMap.pm_pay)+"원"+dcType+"</span></td>"+
								"				</tr>";
								if(busy_type=='0101'){
									busy_1="ptrpr01";
								}else if(busy_type=='0102'){
									busy_2="ptrpr01";
								}else if(busy_type=='0103'){
									busy_3="ptrpr01";
								}else if(busy_type=='0104'){
									busy_4="ptrpr01";
								}else if(busy_type=='0105'){
									busy_5="ptrpr01";
								}else if(busy_type=='0106'){
									busy_6="ptrpr01";
								}else if(busy_type=='0107'){
									busy_7="ptrpr01";
								}else if(busy_type=='0108'){
									busy_8="ptrpr01";
								}else if(busy_type=='0109'){
									busy_9="ptrpr01";
								}
							}else{
								if(busy_type=='0101'){
									busy_1="ptrpr01";
								}else if(busy_type=='0102'){
									busy_2="ptrpr01";
								}else if(busy_type=='0103'){
									busy_3="ptrpr01";
								}else if(busy_type=='0104'){
									busy_4="ptrpr01";
								}else if(busy_type=='0105'){
									busy_5="ptrpr01";
								}else if(busy_type=='0106'){
									busy_6="ptrpr01";
								}else if(busy_type=='0107'){
									busy_7="ptrpr01";
								}else if(busy_type=='0108'){
									busy_8="ptrpr01";
								}else if(busy_type=='0109'){
									busy_9="ptrpr01";
								}
							}
						}
						
						for(var j=0; j<=use_max_cnt ; j++){
							if(ParamIdx!=99999 && man_cnts[ParamIdx]==j){
								if(ParamIdx!=99999 && man_cnts[ParamIdx]==j){
									selectHtml+="<option value=\""+j+"\" selected='selected'>"+j+"</option>";
								}else{
									selectHtml+="<option value=\""+j+"\">"+j+"</option>";	
								}
							}else{
								if(use_man_cnt==j){
									selectHtml+="<option value=\""+j+"\" selected='selected'>"+j+"</option>";
								}else{
									selectHtml+="<option value=\""+j+"\">"+j+"</option>";
								}
							}
							
							
							if(ParamIdx!=99999 && chi_cnts[ParamIdx]==j){
								selectHtml_ch+="<option value=\""+j+"\" selected='selected'>"+j+"</option>";
							}else{
								selectHtml_ch+="<option value=\""+j+"\">"+j+"</option>";	
							}
							
						}

						var r_img = "res_rok.gif";
						var chkYN="";
						
						
						if(ParamIdx!=99999 && pr_nos[ParamIdx]==me_pr_no){
							chkYN=" checked='checked'";
						}
						
						var r_style = "<input type=\"checkbox\""+
						"	class='pg"+this.pg_no+"'		name=\"pr_no_cnts\" value=\""+i+"\" "+chkYN+">";
						if('C'==roomMap.rm_status){
							//결제 완료일때
							r_img="res_rno.gif";
							r_style = "-";
						}else if('R'==roomMap.rm_status){
							//결제 대기중일때
							r_img="res_rmi.gif";
							r_style = "-";
						}
						
						var rsv_daysHtml="";
						//연박 설정
						if(0==roomMap.fromto){
							//해당일 예약불가
							rsv_daysHtml="해당일 연박불가<input name='rsv_days' type='hidden' value='1'/>";
						}else{
							
							if(roomMap.fromto==null){
								rsv_daysHtml=	"<select name=\"rsv_days\"><option value='0'>선택하세요</option>";
								
								if(roomMap.relay_state){
									if("S"==roomMap.relay_state){
										for(var l=2;l<8;l++){
											if(l==roomMap.relay_day){
												rsv_daysHtml+="<option value=\""+l+"\" selected='selected'>"+l+"박 "+(l+1)+"일</option>";
											}else{
												rsv_daysHtml+="<option value=\""+l+"\">"+l+"박 "+(l+1)+"일</option>";	
											}
										}	
									}else{
										for(var l=2;l<8;l++){
											rsv_daysHtml+="<option value=\""+l+"\">"+l+"박 "+(l+1)+"일</option>";
										}	
									}
								}else{
									for(var l=2;l<8;l++){
										rsv_daysHtml+="<option value=\""+l+"\">"+l+"박 "+(l+1)+"일</option>";
									}
								}

								rsv_daysHtml+="					</select>";
							}else{
								rsv_daysHtml+=						"<select name=\"rsv_days\"><option value='0'>선택하세요</option>";
								
								var jNum = 0;
								if(roomMap.relay_state){
									jNum = roomMap.relay_day;
								}
								
								for(var jjj=jNum;jjj<roomMap.fromto;jjj++){
									if(ParamIdx!=99999 && rsv_days[ParamIdx]==(jjj+1)){
										rsv_daysHtml+=
											"<option value=\""+(jjj+1)+"\" selected='selected'>"+(jjj+1)+"박 "+(jjj+2)+"일</option>";
									}else{
										rsv_daysHtml+=						
											"<option value=\""+(jjj+1)+"\">"+(jjj+1)+"박 "+(jjj+2)+"일</option>";	
									}
									
								}
								
								rsv_daysHtml+=						"					</select>";
							}
							if(roomMap.relay_state){
								rsv_daysHtml+="<br/>연박시작일 : "+roomMap.n_reservation_dt.substring(0,4)+"년 ";
								rsv_daysHtml+=roomMap.n_reservation_dt.substring(4,6)+"월 ";
								rsv_daysHtml+=roomMap.n_reservation_dt.substring(6,8)+"일 ";
							}
						}
					
						html+="	<tr align=\"center\">"+
						"		<td width=\"4%\" class=\"border2lbg\"><input name='pr_nos' value='"+this.pr_no+"' type='hidden'/>"+
						r_style+
						"</td>"+
						"		<td width=\"15%\" class=\"border2lbg\"><table border=\"0\""+
						"				cellspacing=\"0\" cellpadding=\"0\">"+
						"				<tr>"+
						"					<td align=\"center\" class=\"ptrroom\">"+this.room_nm+" ("+roomMap.pg_no_nm+")</td>"+
						"				</tr>"+
						"				<tr>"+
						"					<td align=\"center\"><img src=\"/usr/images/"+r_img+"\""+
						"						width=\"46\" height=\"16\"></td>"+
						"				</tr>"+
						"			</table></td>"+
						"		<td width=\"16%\" class=\"border2lbg\"><table border=\"0\""+
						"				cellspacing=\"0\" cellpadding=\"1\">"+
						"				<tr>"+
						"					<td class='tdSelectInfo'>"+
						rsv_daysHtml+
						"</td>"+
						"				</tr>"+
						"				<tr>"+
						"					<td align=\"center\">"+
						"						<!--img src=\"/usr/images/res_another.gif\" width=\"75\" height=\"21\" onClick=\"MM_openBrWindow('pentrip_reservation_droom.htm','','width=320,height=500')\"-->"+
						"					</td>"+
						"				</tr>"+
						"			</table></td>"+
						"		<td width=\"16%\" class=\"border2lbg\">"+
						"		<input name='rrr_pays' value='"+roomMap.rrr_pay+"' type='text' />"+
						"		</td>"+
						"	</tr>";
						
					});
					$("#rooms").html(html);
					
					if("0110"==busy_type){
						$(".tdSelectInfo").html("휴일");
					}
					
				}
			}
	};
	$.getJson(option);
}

//달력에 표시할수 있도록 테이블로 만들어둠
function setTableList(){
	//아이콘 보여줄지 여부
	var p_ico_yn = rooms.list[0].p_ico_yn;
	var html="";
	if(rooms!=null){
		$.each(rooms.list, function (i) {
			if(p_ico_yn=='Y'){
				var room_type = this.room_type;
				var img_src = "res_icon_big.gif";
				if(room_type=="F"){
					img_src ="res_icon_family.gif";
				}else if(room_type=="C"){
					img_src ="res_icon_couple.gif";
				}
				
				html+="<span class='divDel'><br/> <img src='/usr/images/"+img_src+"' width='10' height='10' border=\"0\"> "+
				"<span class=\"ptrnomal\" style=\"cursor: hand\" onMouseMove=\"trackMouse2(event)\"  "+
				"onMouseOver=\"doTooltip3(event,'할로윈','비수기주중','커플룸','원룸형','80,000원')\" "+
				"onMouseOut=\"hideTip2()\"> "+
				"<A HREF=\"/reservation/pentrip_reservation02.htm?uid=caribbean&y=2012&m=02&d=19&selectRoom=209\"> "+
				this.room_nm+"</A></span></span>";
			}else{
				html+="<span class='divDel'><br/> "+
				"<span class=\"ptrnomal\" style=\"cursor: hand\" onMouseMove=\"trackMouse2(event)\"  "+
				"onMouseOver=\"doTooltip3(event,'할로윈','비수기주중','커플룸','원룸형','80,000원')\" "+
				"onMouseOut=\"hideTip2()\"> "+
				"<A HREF=\"/reservation/pentrip_reservation02.htm?uid=caribbean&y=2012&m=02&d=19&selectRoom=209\"> "+
				this.room_nm+"</A></span></span>";
			}
			
		});
	}
	
	return html;
}

//다음달 표시 옵션
var nextMonthYn=false;

//달력을 갱신한다
function changeNewDate(plusVal){
	
	//오늘 무슨요일인지 구하기
	var dt_tmp = setDate.toString("ddd");

	//1일이 수요일이면 dateAdd = 3로 시작하기 위해 처리 0부터 시작
	for(var i=0; i < Date.CultureInfo.abbreviatedDayNames.length;i++){
		if(dt_tmp == Date.CultureInfo.abbreviatedDayNames[i]){
			dayOfTheWeek=i;
			break;
		}
	}

	
	$(".tt").remove();
	setDate.addMonths(plusVal);
	
	setYYYYMM();
	
// 	alert(nextMonth.getDaysInMonth());
	var totalDays =setDate.getDaysInMonth();
	
	var date1 = setDate.clone();
	date1.set({day:1});
		
	var dayName = date1.toString("ddd");
	var dateAdd = 0;


	//1일이 수요일이면 dateAdd = 3로 시작하기 위해 처리 0부터 시작
	for(var i=0; i < Date.CultureInfo.abbreviatedDayNames.length;i++){
		if(dayName == Date.CultureInfo.abbreviatedDayNames[i]){
			dateAdd=i;
			break;
		}
	}

	//다음달 정보
	var chkHideMonth = setDate.getDaysInMonth()+dateAdd;
	var weekCntNext = parseInt(chkHideMonth / 7);
	if((chkHideMonth % 7)>0){
		weekCntNext++;
	}
	//weekCnt1만 씀
	
	var totalDaysAdd= totalDays+dateAdd;
	var weekCnt = parseInt(totalDaysAdd / 7);
	if((totalDaysAdd % 7)>0){
		weekCnt++;
	}

	var html="";
	for(var i=0; i < weekCnt;i++){
		html+="<tr class=\"tt\" align=\"center\" height=\"33\">";
		
		for(var j=1; j<=7;j++){
			if(j==1){
				html+="<td class=\"day"+((i*7)+j)+" redb\"></td>";
			}else if(j==7){
				html+="<td class=\"day"+((i*7)+j)+" blueb\"></td>";
			}else{
				html+="<td class=\"day"+((i*7)+j)+"\"></td>";	
			}
			
		}
		html+="</tr>";
	}
	$("#calTitle").after(html);
	
	var pr_no_tmp = "";
	if(""!="${param.pr_no}"){
		pr_no_tmp="&pr_no=${param.pr_no}";
	}
	for(var i = 1; i <= totalDays; i++ ){
		var day = date1.toString("d");
		if(i!=1 && day=="1"){
			day=date1.toString("M.d");
		}
		
		var htm_tb="<a "+
		"href=\"./petc1004Q.do?p_id=${param.p_id}&reservation_dt="+date1.toString("yyyyMMdd")+pr_no_tmp+"\" "+
			"class=\"\">"+day+"</a>";
		
		var calVal = "day_"+date1.toString("yyyyMMdd");
		
		$(".day"+(i+dateAdd)).html(htm_tb);
		$(".day"+(i+dateAdd)).html(htm_tb);
		if($(".day"+(i+dateAdd)).hasClass("blueb")){
			$(".day"+(i+dateAdd)).find("a").addClass("blueb");
		}else if($(".day"+(i+dateAdd)).hasClass("redb")){
			$(".day"+(i+dateAdd)).find("a").addClass("redb");
		}else{
			$(".day"+(i+dateAdd)).find("a").addClass("bold");
		}
		$(".day"+(i+dateAdd)).attr("id",calVal);
		date1.add(1).days();
	}
	
	var chkNowMonth = setDate.toString("yyyy")+setDate.toString("MM");
	var nowDateYYYYMM  = new Date().toString("yyyyMM");
	if(chkNowMonth==nowDateYYYYMM){
// 		오늘 이전 자료는 숨기기
		$(".tt").find("td").each(function (i){
			if($(this).attr("id")=="day_"+nowDate){
				return false;
			}
			
			$(this).find(".divDel").remove();;

		});	
	}else if(chkNowMonth>nowDateYYYYMM){//월이 오늘보다 크면 걍 두기
		
	}else{//이전이면 모두 어둡게 처리

	}
// 	alert(1);
// 	changeNewDate_N();
// 
// 	calTitle	타이틀

	//예약되어있는 룸 달력에 표시
	var option__ = {
		url: "./pere200_1Q.do",
		data : {"p_id":'${param.p_id}',"reservation_dt":"${reservation_dt}"},
		success : function(json){
			//룸 갯수
			var roomCnt = rooms.list.length;

			//달력에 색칠하기
			if(json!=null && json.list.length>0){
// 				nowDate
				
// 				Date.compare(today, future);
				var nDataChk = new Date();
				nDataChk.set({year:Number(nowDate.substr(0,4)),month:Number(nowDate.substr(4,2))-1,day:Number(nowDate.substr(6,2))});
				$.each(json.list, function (i) {
					var nDataChk1 = new Date();
					nDataChk1.set({year:Number(this.reservation_dt.substr(0,4)),month:Number(this.reservation_dt.substr(4,2))-1,day:Number(this.reservation_dt.substr(6,2))});
					
					if(nDataChk- nDataChk1<0){
						if(roomCnt==this.cnt){
							//예약 다 찬거
							$("#day_"+this.reservation_dt).attr("bgcolor","#FAFC98");
						}else{
							//예약방이 남아 있는자료
							$("#day_"+this.reservation_dt).attr("bgcolor","#FEF0FE");
						}
					}
				
				});	
			}
			//오늘 날짜 표시 
			$("#day_"+nowDate).attr("bgcolor","#e3fefe");
			//선택된 날짜표시
			var chkIcon = "<div id=\"event\" style=\"position:absolute; z-index:0 display:block;width: 45px;\">"+
				"	<img src=\"/usr/images/res_icon_today.gif\" width=\"15\" height=\"15\" border=\"0\">"+
				"</div>";
			$("#day_${param.reservation_dt}").prepend(chkIcon);
		}
	};
// 	alert(2);
	$.getJson(option__);
	//빈 테이블 그레이 처리 
	$(".tt").find("td").each(function (i){
		if($(this).html()=="&nbsp;&nbsp;&nbsp;"){
			$(this).attr("bgcolor","#F8F6F7");
		}
	});	

	
	//객실 그리기
	setRooms();
}

//메인 날짜 변경
function setYYYYMM(){
	$("#yyyyMMdd").html(setDate.toString("yyyy")+"년 "+setDate.toString("MM")+"월 "+setDate.toString("dd")+"일");
	$("#year").html(setDate.toString("yyyy"));
	$("#month").html(setDate.toString("MM"));
		
}

var send_chk=false;
//다음페이지 
function setData(status){
	if(send_chk){
		alert("처리중입니다.");
		return false;
	}
	if($("#reservation_nm").val()==''){
		alert("예약자명을 입력하세요");
		$("#reservation_nm").focus();
		return false;
	}
	
	if($("#r_phone2").val()==''){
		alert("휴대폰은 입력하세요");
		$("#r_phone2").focus();
		return false;
	}
	if($("#r_phone3").val()==''){
		alert("휴대폰은 입력하세요");
		$("#r_phone3").focus();
		return false;
	}
	
	if($("input[name='pr_no_cnts']:checked").length==0){
		alert("사이트을 선택하세요");
		return false;
	}
	$("#rm_status").val(status);
	send_chk=true;
	$("#frmData").submit();
}


//이메일 넣기
function changeEmail(val){
	if($(val).val()==''){
		$('#r_email2').show();
	}else{
		$('#r_email2').hide();
	}
	$('#r_email2').val($(val).val());
}

//데이터 체크
function addAdmin(){
	
// 	addAdmin
	if($("#chkAdmin:checked").length==0){
		$("#reservation_nm").val("");
		$("#r_phone1").val("010");
		$("#r_phone2").val("");
		$("#r_phone3").val("");
	}else{
		
		$("#reservation_nm").val("${pensionInfo.p_usr_nm}");
		$("#r_phone1").val("${pensionInfo.p_phone1}");
		$("#r_phone2").val("${pensionInfo.p_phone2}");
		$("#r_phone3").val("${pensionInfo.p_phone3}");
	}
}

function chkGroup(me){
	
	if($("#pg_no"+$(me).val()+":checked").length==0){
		$(".pg"+$(me).val()).attr("checked",false);
	}else{
		$(".pg"+$(me).val()).attr("checked",true);
	}
}

//선택한 자료 모두 변경
function changeSelect(me){
	$("input[name='pr_no_cnts']:checked").each(function (){
		$(this).parent().parent().find("select").val($(me).val());
	});
}

function changeSelectInput(me){
	$("input[name='pr_no_cnts']:checked").each(function (){
		$(this).parent().parent().find("input[name='rrr_pays']").val($(me).val());
	});
}


</script>



<form action="./petc1005T.do"  id="frmData" method="post">
<input type="hidden" name="p_id" value="${param.p_id}">
<input type="hidden" name="reservation_dt" id="reservation_dt" value="${reservation_dt}">
<input type="hidden" name="rm_status" id="rm_status" value="">
<!-- 지불방법 지금은 고정 -->
<input type="hidden" name="pay_type" id="pay_type" value="1">

	
<table width="100%" border="0" cellspacing="0" cellpadding="10">
	<tr>
		<td valign="top">
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td width="100%" align="left" valign="top"><table border="0"
							cellspacing="0" cellpadding="3" width="97%">
							<tr>
								<td align="center">
									<div style="height: 25px;">
										<a href="#" onclick="changeNewDateRedirect(-1);"><img alt=""
											src="/camping/img/calendar_arrow_l.jpg"
											style="vertical-align: top; padding-top: 3px; padding-right: 10px;"></a>
										<strong style="font-size: 13px; font-weight: bold; font-family: Arial Black" id="yyyyMMdd"></strong> 
										<a href="#" onclick="changeNewDateRedirect(1);"><img alt="" src="/camping/img/calendar_arrow_r.jpg"
											style="vertical-align: top; padding-top: 3px; padding-left: 10px;"></a>
									</div>
									<table class="lCalTable" style="width: 100%;">
										<colgroup>
											<col width="100" />
											<col width="100" />
											<col width="100" />
											<col width="100" />
											<col width="100" />
											<col width="100" />
											<col width="100" />
										</colgroup>
										<tbody>
											<tr id="calTitle">
												<th class="calRed">일</th>
												<th>월</th>
												<th>화</th>
												<th>수</th>
												<th>목</th>
												<th>금</th>
												<th class="calBlue">토</th>
											</tr>
										</tbody>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table> <br>

	<c:if test="${groups !=null && fn:length(groups)>0 }">
		<c:forEach var="gp" items="${groups}" varStatus="status">
			<c:if test="${status.index!=0 }">,</c:if>
<input type="checkbox" id="pg_no${gp.pg_no }" onclick="chkGroup(this);" value="${gp.pg_no }" >${gp.group_nm }
		</c:forEach>
	</c:if>
	<select id="selBox" onchange="changeSelect(this);" >
		<option value="0">선택하세요</option>
		<option value="2">2박3일</option>
		<option value="3">3박4일</option>
		<option value="4">4박5일</option>
		<option value="5">5박6일</option>
		<option value="6">6박7일</option>
		<option value="7">7박8일</option>
	</select>
	<input name="mechk" value="0" type="text" onkeyup="changeSelectInput(this);" />
			<table width="100%" border="1" cellspacing="0" cellpadding="0"  style="border-color:#f6f5f5;" >
				<tr>
					<td align="center"><table width="100%" border="0"
							cellspacing="2" cellpadding="0">
							<tr>
								<td height="45" bgcolor="#f6f5f5"><table width="100%"
										border="0" cellspacing="0" cellpadding="2">
										<tr align="center">
											<td width="4%">&nbsp;</td>
											<td width="15%">사이트명</td>
											<td width="16%">기간</td>
											<td width="16%">할인금액</td>
										</tr>
									</table></td>
							</tr>
							<tr>
								<td
									style="border-top-color: #bfbfbf; border-top-style: solid; border-top-width: 1px;">
<!-- 									객실목록 -->
<table width="100%" border="0" cellspacing="0" cellpadding="2">
	<tbody id="rooms">
	
	</tbody>
</table>
									</td>
							</tr>
						</table></td>
				</tr>
			</table> <br>

      		<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td>&nbsp;</td>
				</tr>
				<tr>
					<td align="center" id="tdSaveBtn"><table width="100" border="0"
							cellspacing="0" cellpadding="2">
							<tr>
								<td><A HREF="#" onclick="setData();">[저장]</A></td>
							</tr>
						</table></td>
				</tr>
				<tr>
					<td align="center">&nbsp;</td>
				</tr>
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td height="3" bgcolor="#86ad29"></td>
				</tr>
				<tr>
					<td style="padding-top: 2px;"><%@ include file="/WEB-INF/jsp/usr/pe/re/footer.jsp"%></td>
				</tr>
			</table></td>
	</tr>
</table>


</form>